package com.shop.controller;


import com.shop.model.vo.Rsp;
import com.shop.service.CollectionService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

/**
 * (Collection)表控制层
 *
 * @author makejava
 * @since 2020-11-21 12:10:36
 */
@Validated
@RestController
@AllArgsConstructor
public class CollectionController {
    /**
     * 服务对象
     */
    private final CollectionService collectionService;

    @GetMapping("collectionCount")
    public Rsp collectionCount(@RequestHeader("userId") int userId) {
        return collectionService.collectionCount(userId);
    }

    @GetMapping("getCollectionList")
    public Rsp getCollectionList(@RequestHeader("userId") int userId) {
        return collectionService.getCollectionList(userId);
    }

    @GetMapping("addCollection")
    public Rsp addCollection(@RequestHeader("userId") int userId,Integer merchantId) {
        return collectionService.addCollection(userId,merchantId);
    }
}
